//
//  FZDubEvaluationManager.h
//  KidDubbing
//
//  Created by Victor Ji on 2016/11/9.
//  Copyright © 2016年 Feizhu Tech. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SREvaluationScoreModel.h"
#import "SREvaluationWordScoreModel.h"

typedef NS_ENUM(NSUInteger, FZDubEvaluationSupplier) {
    FZDubEvaluationSupplierIfly,    // 讯飞
    FZDubEvaluationSupplierChivox   // 驰声
};

typedef NS_ENUM(NSUInteger, SRSpeakingEvaluationTextType) {
    SRSpeakingEvaluationTextTypeEnglish,
    SRSpeakingEvaluationTextTypeChinese
};

typedef NS_ENUM(NSUInteger, SRSpeakingEvaluationStatus) {
    SRSpeakingEvaluationStatusBegin,
    SRSpeakingEvaluationStatusStartRecord,
    SRSpeakingEvaluationStatusStartRecordFail,
    SRSpeakingEvaluationStatusRecording,
    SRSpeakingEvaluationStatusStopRecord,
    SRSpeakingEvaluationStatusStopRecordFail,
    SRSpeakingEvaluationStatusEvaluating,
    SRSpeakingEvaluationStatusNetworkError,
    SRSpeakingEvaluationStatusFail,
    SRSpeakingEvaluationStatusSuccess
};

@protocol SREvaluationManagerDelegate <NSObject>

- (void)speakingEvaluationSuccess:(SREvaluationScoreModel *)scoreModel;

- (void)speakingEvaluationStatusChanged:(SRSpeakingEvaluationStatus)evaluationStatus message:(NSString *)message;

//- (void)dubEvaluationRecordToken:(NSString *)recordToken;

@end

@interface SREvaluationManager : NSObject

+ (SREvaluationManager *)sharedManager;

@property (weak, nonatomic) id<SREvaluationManagerDelegate> delegate;

/**
 手动设置测评供应商

 @param supplier 供应商
 */
- (void)setEvaluationSupplier:(FZDubEvaluationSupplier)supplier language:(SRSpeakingEvaluationTextType)language;


/**
 设置测评语言

 @param language 语言
 */
- (void)setLanguage:(SRSpeakingEvaluationTextType)language;

/**
 从服务器请求测评供应商

 @param supplier 未请求成功情况下的默认供应商
 */
- (void)queryEvaluationSupplierFromServerWithDefaultSupplier:(FZDubEvaluationSupplier)supplier;


/**
 开始录音

 @param text 测评文本
 */
- (void)startRecordWithText:(NSString *)text textType:(SRSpeakingEvaluationTextType)textType bonusArray:(NSArray *)bonusArray;

/**
 停止录音
 */
- (void)stopRecord;


@end
